<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('mobile',20)->unique()->comment('手机号码');
            $table->string('password',100)->comment('密码');
            $table->string('realname',20)->unique()->comment('真实姓名');
            $table->string('cityauth',2000)->comment('可操作城市');//json格式
            $table->integer('roleid')->comment('角色ID');
            $table->string('rolename',20)->comment('角色名');
            $table->tinyInteger('isalldata')->comment('是否可看全局数据');
            $table->string('cityid', 512)->default('')->comment('所属城市ID');
            $table->string('districtid', 1000)->default('')->comment('商务所属区县');
            $table->string('auth',2000)->comment('权限列表');//json格式，只有value，没有key。一维。
            $table->dateTime('logintime')->comment('最后登录时间');
            $table->dateTime('deserttime')->comment('离职时间');
            $table->tinyInteger('status')->default(1)->comment('状态1在岗2离职3辞退');
            $table->string('note',512)->default('')->comment('备注');
            $table->integer('adminid')->default(1)->comment('操作员ID');
            $table->string('cardholder', 32)->default('')->comment('');
            $table->string('bankname',30)->default('')->comment('所属银行');
            $table->string('bankcard',30)->default('')->comment('银行卡号');
            $table->string('opencardbank',30)->default('')->comment('开户行');
            $table->string('bankprovince',30)->default('')->comment('银行卡所属省');
            $table->string('bankcity',30)->default('')->comment('银行卡所属市');
            $table->string('remember_token');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('shop_users');
    }
}
